/**
 * Copyright (C) 2013 Daniel Gee.
 * See LICENSE.txt for more details.
 */
package quickcheck.generators;

import net.java.quickcheck.Generator;
import net.java.quickcheck.generator.PrimitiveGenerators;

import com.rl.dungeon.Location;

/**
 * Generates random {@link Location} instances.
 * 
 * @author Daniel Gee
 */
public class LocationGenerator implements Generator<Location>
{
	/**
	 * Used to call up Locations with {@link Location#of(int, int, int)}.
	 */
	private final Generator<Integer> intGen;

	/**
	 * Makes a new LocationGenerator.
	 */
	public LocationGenerator()
	{
		this.intGen = PrimitiveGenerators.integers();
	}

	/**
	 * @see net.java.quickcheck.Generator#next()
	 */
	@Override
	public Location next()
	{
		return Location.of(intGen.next(), intGen.next(), intGen.next());
	}
}
